#ifndef USER_CONTROLLED_INPUT_DEVICE
#define USER_CONTROLLED_INPUT_DEVICE

#include "InputDevice.h"

/*
 * class to handle input from any user controlled device, e.g. a mouse
 */
class UserControlledInputDevice : public InputDevice
{
public:
    UserControlledInputDevice();
    virtual ~UserControlledInputDevice() {}
    // override this to destory the OIS device in use
    virtual void destroy(OIS::InputManager *i_m) = 0;
    virtual void capture() = 0;
    // override to return the change in x value since the last call
    virtual Ogre::Radian getX() = 0;
    // override to return the change in y value since the last call
    virtual Ogre::Radian getY() = 0;
    // register a ball to control with this device.
    virtual bool registerBall(Ball *b);
    // unregister the ball from this device (if there is one registered)
    virtual void unregisterBall();
    // this is called to set the force acting on the ball. time is time since last call
    virtual void updateBall(Ogre::Real time);
    // set device to be at the center of its movement (x = y = 0)
    virtual void reset();
    virtual bool isResettable() { return true; }
protected:
    // x_factor and y_factor are angle (in radians) to rotate by for each 1 of x and y movement
    float x_factor, y_factor;
    Ogre::Radian roll, pitch;
    virtual void initialise() { pitch = roll = Ogre::Radian(0); }
} ;

#endif
